import prompt from '@blueos.window.prompt'

let _timer;
export const showToast = (message, cb) => {
  prompt.showToast({
    message,
    // duration: 1
  })
  clearTimeout(_timer)
  _timer = setTimeout(() => {
    cb && cb()
  }, 5000)
}


export const releaseToast = () => {
  clearTimeout(_timer)
}